package com.sc.controller;

import cn.hutool.core.util.ReUtil;
import cn.hutool.crypto.SecureUtil;
import com.mybatisflex.core.query.QueryWrapper;
import com.sc.dto.LoginDTO;
import com.sc.entity.Emp;
import com.sc.result.Result;
import com.sc.result.ResultCode;
import com.sc.service.EmpService;
import com.sc.util.JwtUtil;
import com.sc.util.RegexUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.filter.OncePerRequestFilter;

@RestController
@RequestMapping("/api/v1/auth")
public class AuthController {  
  
    @Autowired
    private EmpService empService;
  
    @PostMapping("/login")
    public Object createAuthenticationToken(@RequestBody LoginDTO dto) throws Exception {
        return empService.login(dto);
    }
}